<%@ page language="java" contentType="text/html; charset=UTF-8"
         pageEncoding="UTF-8" %>
<%@ include file="/static/common/taglibs.jsp" %>
<c:set var="ctx" value="${pageContext.request.contextPath}"/>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
    <meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7"/>
    <meta name="author" content="jack"/>
    <meta name="keywords" content="网页描述"/>
    <meta name="description" content="网页关键字"/>
    <title>我的珠宝店</title>
    <link rel="stylesheet" type="text/css" href="${ctx}/static/css/global.css"/>
    <link rel="stylesheet" type="text/css" href="${ctx}/static/css/layout.css"/>
    <script type="text/javascript" src="${ctx}/static/js/jquery.min.js"></script>
    <script type="text/javascript" src="${ctx}/static/js/global.js"></script>
    <script type="text/javascript" src="${ctx}/static/js/jewel-list.js"></script>
    <title></title>
  <%--  <script type="application/javascript">
        var pageNum = 0;
        $(document).ready(function () {
            $("#search_btn").click(function () {
                search(0);
            });
        });

        function addShopCar(id) {
//            alert(id);
            $.post("${ctx}/jewel/addShopCar", {id: id},
                    function (data) {
                        if (data != null) {
                            alert(data);
                            search(0);
                        }
                    });
        }


        function addShopCars() {
            var chk_value = [];
            $('input[name="jewelItem"]:checked').each(function () {
                if($(this).val()!=''){
                    chk_value.push($(this).val());
                }
            });
//            alert(chk_value);
            if (chk_value.length == 0) {
                alert("请选择钻石");
            } else {
                $.post("${ctx}/jewel/addShopCars", {ids: chk_value.toString()},
                        function (data) {
                            if (data != null) {
                                alert(data);
                                search(0);
                            }
                        });
            }

        }

        function search(isLoadMore) {
            if (isLoadMore == 1) {
                pageNum++;
            } else {
                pageNum = 0;
            }
            var shape = "";//形状
            var color = "";//颜色
            var cut = ""; // 切工
            var neatness = "";//净度
            var buffing = "";//抛光
            var fluorescence = "";//荧光
            var card = "";//证书
            var symmetry = "";//对称
            var order = "";//排序
            var holdType = "";//库存
            var num = $("input[name='num']").val();//货号
            var cardId = $("input[name='cardId']").val();//证书号
            var startPrice = $("input[name='startPrice']").val();
            var endPrice = $("input[name='endPrice']").val();
            var startWeight = $("input[name='startWeight']").val();
            var endtWeight = $("input[name='endtWeight']").val();

            order = $(".cur.a1").text().trim();
            holdType = $(".cur.a2").text().trim();
            $(".cur[name='search_shape']").each(function () {
                shape = shape + $(this).text().trim() + ",";
            });
            $(".cur[name='search_color']").each(function () {
                color = color + $(this).text().trim() + ",";
            });
            $(".cur[name='search_cut']").each(function () {
                cut = cut + $(this).text().trim() + ",";
            });
            $(".cur[name='search_neatness']").each(function () {
                neatness = neatness + $(this).text().trim() + ",";
            });
            $(".cur[name='search_buffing']").each(function () {
                buffing = buffing + $(this).text().trim() + ",";
            });
            $(".cur[name='search_fluorescence']").each(function () {
                fluorescence = fluorescence + $(this).text().trim() + ",";
            });
            $(".cur[name='search_card']").each(function () {
                card = card + $(this).text().trim() + ",";
            });
            $(".cur[name='search_symmetry']").each(function () {
                symmetry = symmetry + $(this).text().trim() + ",";
            });
            shape = shape.substring(0, shape.lastIndexOf(","));
            color = color.substring(0, color.lastIndexOf(","));
            cut = cut.substring(0, cut.lastIndexOf(","));
            neatness = neatness.substring(0, neatness.lastIndexOf(","));
            buffing = buffing.substring(0, buffing.lastIndexOf(","));
            fluorescence = fluorescence.substring(0, fluorescence.lastIndexOf(","));
            card = card.substring(0, card.lastIndexOf(","));
            symmetry = symmetry.substring(0, symmetry.lastIndexOf(","));
            $.post("${ctx}/jewel/search",
                    {filter_holdType: holdType, filter_order: order, filter_shape: shape, filter_color: color,
                        filter_cut: cut, filter_neatness: neatness, filter_buffing: buffing,
                        filter_fluorescence: fluorescence, filter_card: card, filter_symmetry: symmetry,
                        filter_num: num, filter_cardId: cardId, filter_startPrice: startPrice,
                        filter_endPrice: endPrice, filter_startWeight: startWeight,
                        filter_endtWeight: endtWeight, page: pageNum, isLoadMore: isLoadMore},
                    function (data) {
                        if (isLoadMore == 0) {
                            $(data).replaceAll($("#jewel_results"));
                        } else {
                            $("#table").append($(data));
                        }
                    });
        }
    </script>--%>
</head>
<body>
<%--<input type="hidden" id="ctx" value="${ctx}"/>--%>
<div id="wrap" style="position:relative;">
<div class="head">
    <div class="top">
        <h1><a href="${ctx}/index/toIndex"><img src="${ctx}/static/images/logo_head.jpg" alt=""/></a></h1>

        <div class="nav"><a href="${ctx}/index/toIndex"><img src="${ctx}/static/images/top_xtb.jpg" alt=""/>　挑选钻石/戒托</a>　|　<a href="${ctx}/account/user/"><img src="${ctx}/static/images/head_xtb1.jpg" alt=""/>　我的帐户
        </a>　|　<a href="${ctx}/ShopCart/"><img src="${ctx}/static/images/head_xtb2.jpg" alt=""/>　购物车 <b id="shopCartCount">0</b> 件</a>　|　
            <a href="${ctx}/logout"><img src="${ctx}/static/images/head_xtb3.jpg"  alt=""/>　退出登录</a></div>
        <div class="del_float"></div>
    </div>
</div>
<div class="zuan_list" id="zuan_list">
<h2><span><a href="${ctx}/ring/"><img src="${ctx}/static/images/jie_btn.jpg" alt=""/></a></span>挑选钻石</h2>

<div class="del_float"></div>
<div class="zhuan_list_table">
<h3><img src="${ctx}/static/images/zhuan_h3_xtb.jpg" alt=""/>本期美元汇率：<b>${rate }</b></h3>

<div class="one">
    <span>形状<br/><b>Shape</b></span>
    <dl>
        <a name="search_shape">
            <dt><img src="${ctx}/static/images/zhuan_xt1.png" alt=""/></dt>
            <dd>圆形</dd>
        </a>
    </dl>
    <dl>
        <a name="search_shape">
            <dt><img src="${ctx}/static/images/zhuan_xt2.png" alt=""/></dt>
            <dd>公主方</dd>
        </a>
    </dl>
    <dl>
        <a name="search_shape">
            <dt><img src="${ctx}/static/images/zhuan_xt3.png" alt=""/></dt>
            <dd>梨形</dd>
        </a>
    </dl>
    <dl>
        <a name="search_shape">
            <dt><img src="${ctx}/static/images/zhuan_xt4.png" alt=""/></dt>
            <dd>心形</dd>
        </a>
    </dl>
    <dl>
        <a name="search_shape">
            <dt><img src="${ctx}/static/images/zhuan_xt5.png" alt=""/></dt>
            <dd>橄榄</dd>
        </a>
    </dl>
    <dl>
        <a name="search_shape">
            <dt><img src="${ctx}/static/images/zhuan_xt6.png" alt=""/></dt>
            <dd>椭圆形</dd>
        </a>
    </dl>
    <dl>
        <a name="search_shape">
            <dt><img src="${ctx}/static/images/zhuan_xt7.png" alt=""/></dt>
            <dd>祖母绿</dd>
        </a>
    </dl>
    <dl>
        <a name="search_shape">
            <dt name="search_shape"><img src="${ctx}/static/images/zhuan_xt8.png" alt=""/></dt>
            <dd>其他</dd>
        </a>
    </dl>
    <span>重量<br/><b>Carat</b></span>
    <input type="text" name="startWeight" class="put1"/><b style="float:left;padding-top:20px;">
    &nbsp;-&nbsp;</b>
    <input type="text" name="endWeight" class="put1"/>
    <span style="margin-left:3px;margin-right:0;padding-top:11px;">CT　</span>

    <div class="del_float"></div>
</div>
<div class="two">
    <span>颜色<br/><b>Color</b></span>
    <a name="search_color">D</a>
    <a name="search_color">E</a>
    <a name="search_color">F</a>
    <a name="search_color">G</a>
    <a name="search_color">H</a>
    <a name="search_color">I</a>
    <a name="search_color">J</a>
    <a name="search_color">K</a>
    <a name="search_color">L</a>
    <a name="search_color">M</a>
    <a name="search_color">≤N</a>
    <span>切工<br/><b>Cut</b></span>
    <a name="search_cut">ID</a>
    <a name="search_cut">EX</a>
    <a name="search_cut">VG</a>
    <a name="search_cut">GD</a>
    <a name="search_cut">FR</a>

    <div class="del_float"></div>
</div>
<div class="two">
    <span>净度<br/><b>Clarity</b></span>
    <a name="search_neatness">FL</a>
    <a name="search_neatness">IF</a>
    <a name="search_neatness">VVS1</a>
    <a name="search_neatness">VVS2</a>
    <a name="search_neatness">VS1</a>
    <a name="search_neatness">VS2</a>
    <a name="search_neatness">SI1</a>
    <a name="search_neatness">SI2</a>
    <a name="search_neatness">SI3</a>
    <a name="search_neatness">I1</a>
    <a name="search_neatness">≤I2</a>
    <span>抛光<br/><b>Polish</b></span>
    <a name="search_buffing">ID</a>
    <a name="search_buffing">EX</a>
    <a name="search_buffing">VG</a>
    <a name="search_buffing">GD</a>
    <a name="search_buffing">FR</a>

    <div class="del_float"></div>
</div>
<div class="two">
    <span>荧光<br/><b>Flu</b></span>
    <a name="search_fluorescence">N</a>
    <a name="search_fluorescence">F</a>
    <a name="search_fluorescence">M</a>
    <a name="search_fluorescence">S</a>
    <a name="search_fluorescence">VS</a>
    <span>证书<br/><b>Cert</b></span>
    <a name="search_card">GIA</a>
    <a name="search_card">国检</a>
    <a name="search_card">HRD</a>
    <a name="search_card">IGI</a>
    <span>对称<br/><b>Symmetry</b></span>
    <a name="search_symmetry">ID</a>
    <a name="search_symmetry">EX</a>
    <a name="search_symmetry">VG</a>
    <a name="search_symmetry">GD</a>
    <a name="search_symmetry">FR</a>

    <div class="del_float"></div>
</div>
<div class="two three">
    <span>排序<br/><b>Sort</b></span>
    <a class="a1" name="o1">折扣从高到低</a>
    <a class="a1" name="o2">折扣从低到高</a>
    <a class="a1" name="o3">价格从高到低</a>
    <a class="a1" name="o4">价格从低到高</a>
    <span>所在地<br/><b>Location</b></span>
    <a name="search_holdType" class="a2">现货库存</a>
    <a name="search_holdType" class="a2">海外库存</a>

    <div class="del_float"></div>
</div>
<div class="one" style="padding-top:0;">
    <span>货号<br/><b>Item No</b></span>
    <input type="text" name="num" class="put2"/>
    <span>证书号<br/><b>Cert No.</b></span>
    <input type="text" name="cardId" class="put2"/>
    <span>价格<br/><b>Price</b></span>
    <input type="text" name="startPrice" class="put1"/><b style="float:left;padding-top:20px;">&nbsp;-&nbsp;</b>
    <input type="text" name="endPrice" class="put1"/>
    <span style="margin-left:3px;margin-right:0;padding-top:11px;">元　</span>

    <div class="del_float"></div>
</div>
<div class="search_btn"><a class="btn1" id="search_btn">&nbsp;</a>
    <a class="btn2" id="starset">&nbsp;</a>
</div>
<div id="jewel_results">
    <p id="searchLoading"></p>
  <%--   <p>从库存中找到 <b>${jewelNum }</b> 颗钻石</p> --%>
    <table class="table_zuan_list" cellpadding="0" cellspacing="0" border="0" id="table">
        <tr>
            <th width="30"><input name="jewelItem" type="checkbox" value="" class="zuan_list_all"/></th>
            <th width="105">货号</th>
            <th width="46">形状</th>
            <th width="40">重量</th>
            <th width="40">颜色</th>
            <th width="49">净度</th>
            <th width="41">切工</th>
            <th width="42">抛光</th>
            <th width="41">对称</th>
            <th width="41">荧光</th>
            <th width="43">证书</th>
            <th width="88">证书号</th>
            <th width="114">尺寸</th>
            <th width="70">国际报价</th>
            <th width="50">折扣</th>
            <th width="80">人民币价格</th>
            <th width="65">订购</th>
        </tr>

        <c:forEach items="${jewels }" var="jewel">
            <tr>
                <td width="30"><input name="jewelItem" type="checkbox" value="${jewel.id}" class="zuan_list_check"/></td>
                <td width="105">${jewel.num}</td>
                <td width="46">${jewel.shape}</td>
                <td width="40">${jewel.weight}</td>
                <td width="40">${jewel.color}</td>
                <td width="49">${jewel.neatness}</td>
                <td width="41">${jewel.cut}</td>
                <td width="42">${jewel.buffing}</td>
                <td width="41">${jewel.symmetry}</td>
                <td width="41">${jewel.fluorescence}</td>
                <td width="43">${jewel.card}</td>
                <td width="88">${jewel.cardId}</td>
                <td width="114">${jewel.size}</td>
                <td width="70">${jewel.internationalPrice}</td>
                <td width="50"><fmt:formatNumber value="${jewel.secondDiscount}" pattern="0.00" type="number"/></td>
                <td width="80"><fmt:formatNumber value="${jewel.secondPrice}" pattern="0" type="number"/></td>
                <td width="65" class="dinggou">
                   <%-- <a onclick="addShopCar(${jewel.id})">&nbsp;</a>--%>
                    <a href="${ctx}/jewel/addShopCar?id=${jewel.id}">&nbsp;</a>

                    <div class="more">
                        <p>所在地：${jewel.holdType}</p>

                        <p>奶油色：${jewel.hasMilkColor}</p>

                        <p>咖啡色：${jewel.hasCoffeeColor}</p>

                        <p>绿　色：${jewel.hasGreenColor}</p>
                    </div>
                </td>
            </tr>
        </c:forEach>

        <tr id="moreTr">
            <td colspan="17"  onclick="search(1)" >点击加载更多</td>
        </tr>

    </table>
</div>
<%--<table>
    <tr style="width: 100%">
        <td></td>
        <td></td>
        <td></td>
        <td></td>
        <td></td>
        <td></td>
        <td></td>
        <td></td>
        <td colspan="17" onclick="search(1)" align="center" style="width: 100%">
            <div><a href="javascript:void(0);" >点击加载更多</a></div></td>
        <td></td>
        <td></td>
        <td></td>
        <td></td>
        <td></td>
        <td></td>
        <td></td>
        <td></td>
    </tr>
</table>--%>
</div>
</div>

<span id="ding_btn1"><a href="${ctx}/ShopCart/">购物车 <b id="shopCartCount2">0</b> 件</a></span>
<span id="ding_btn2"><img src="/xipujewelWeb/static/images/ding_btn1-02.png"/></span>

<div class="zuan_tan">
    <span><img src="/xipujewelWeb/static/images/zuan_tan_btn_close.jpg" alt=""></span>
    <p id="text"><img src="/xipujewelWeb/static/images/zuan_tan_cheng.jpg" alt=""></p>
    <a href="#" class="sure_btn">&nbsp;</a>
</div>

<div class="footer_btn">
    <div class="btn_foot"><a class="btn1" onClick="addShopCars()">&nbsp;</a>
        <a href="${ctx}/order/toCommit" class="btn2">&nbsp;</a>
    </div>
</div>
</div>


</body>
</html>